package com.study.ext;

import java.util.List;

/**
 * @Author tanglingyu
 * @Date: 2021/06/06/ 14:49
 * @Description
 */
public abstract class AbstractBusiness1Factory implements ApplyInterface {


  @Override
  public StrategyInterface newStrategyInterface(StrategyEnum strategyEnum) {

    for (StrategyInterface strategy : getStrategyInterfaces()) {
      if (strategy.getStrategyName().equals(strategyEnum)) {
        return strategy;
      }
    }
    return null;
  }


  protected abstract List<StrategyInterface> getStrategyInterfaces();

}
